<?php


namespace app\admin\controller\base;


use app\admin\service\base\GradesService;
use app\BaseController;
use think\response\Json;

/**
 * 班级管理控制器
 * Class Grades
 * @package app\admin\controller\base
 */
class Grades extends BaseController
{
    /**
     * 班级列表
     * @return Json
     */
    public function index(GradesService $gradesService):Json
    {
        $params = request()->param();
        return $gradesService->index($params);
    }

    /**
     * 详情
     * @param GradesService $gradesService
     * @return Json
     */
    public function read(GradesService $gradesService):Json
    {
        $params = request()->param();
        return $gradesService->read($params);
    }

    /**
     * 创建班级
     * @return Json
     */
    public function save(GradesService $gradesService):Json
    {
        $params = request()->param();
        return $gradesService->save($params);
    }

    /**
     * 更新班级信息
     * @return Json
     */
    public function update(GradesService $gradesService):Json
    {
        $params = request()->param();
        return $gradesService->update($params);
    }


    /**
     * 删除班级信息
     * @return Json
     */
    public function delete(GradesService $gradesService):Json
    {
        $params = request()->param();
        return $gradesService->delete($params);
    }
}